package com.cloud.spring.demo.service;

import com.cloud.spring.dao.UserDao;
import com.cloud.spring.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    UserDao userDao;

    public int insert(User user) {
        return userDao.insert(user);
    }

    public List<User> findById2(int id) {
        return userDao.findById2(id);
    }

    public List<User> findById3(int id) {
        return userDao.findById3(id);
    }

    public int updateUserById(User user) {
        return userDao.updateUserById(user);
    }

    public int insertBatch(List<User> userList) {
        return userDao.insertBatch(userList);
    }

    public List<User> selectBatch(List<Integer> ids) {
        return userDao.selectBatch(ids);
    }
}
